package com.hkts.sinoiov.sinoiovLocation.service.serviceimpl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hkts.sinoiov.sinoiovLocation.entity.SinoiovLocation;
import com.hkts.sinoiov.sinoiovLocation.mapper.SinoiovLocationMapper;
import com.hkts.sinoiov.sinoiovLocation.service.ISinoiovLocationService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.apache.commons.lang.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

import java.util.List;

/**
 * <p>
 * 实时位置 服务实现类
 * </p>
 *
 * @author hml
 * @since 2021-08-12
 */
@Service
@Transactional
public class SinoiovLocationServiceImpl extends ServiceImpl<SinoiovLocationMapper, SinoiovLocation> implements ISinoiovLocationService {


    @Autowired
    private SinoiovLocationMapper sinoiovLocationMapper;

    @Override
    public IPage<SinoiovLocation> selectPage(Page<SinoiovLocation> page, SinoiovLocation sinoiovLocation) {
        QueryWrapper<SinoiovLocation> query = Wrappers.query();
        QueryWrapper<SinoiovLocation> entityWrapper = getEntityWrapper(query, sinoiovLocation);
        return sinoiovLocationMapper.selectPage(page, entityWrapper);
    }


    @Override
    public List<SinoiovLocation> selectList(SinoiovLocation sinoiovLocation) {
        QueryWrapper<SinoiovLocation> query = Wrappers.query();
        QueryWrapper<SinoiovLocation> entityWrapper = getEntityWrapper(query, sinoiovLocation);
        return sinoiovLocationMapper.selectList(entityWrapper);
    }

    /**
     * 公共查询条件
     *
     * @param entityWrapper
     * @return
     */
    public QueryWrapper<SinoiovLocation> getEntityWrapper(QueryWrapper<SinoiovLocation> entityWrapper, SinoiovLocation sinoiovLocation) {

        return entityWrapper;
    }
}
